$(function() {
//	此段与js插件无关仅用于设置a标签href值跳转搜索页
	var $data_father = '';
    var $data_name = '';
    
    
	//Init Navigation
	var nav = $('.swiper-nav').swiper({
		slidesPerView: 'auto',
		freeMode: true,
		noSwiping: true,
		freeModeFluid: true,
		calculateHeight: true,
		visibilityFullFit: true,
		onSlideClick: function(nav) {
			pages.swipeTo(nav.clickedSlideIndex)
		}
	})

	//Function to Fix Pages Height
	function fixPagesHeight() {
		$('.swiper-pages').css({
			height: $(window).height() - nav.height - 48
		})
	}
	$(window).on('resize', function() {
		fixPagesHeight()
	})
	fixPagesHeight()

	//Init Pages
	var pages = $('.swiper-pages').swiper({
		noSwiping: true,
		onSlideChangeStart: function() {
			$(".swiper-nav .active").removeClass('active')
			$(".swiper-nav .swiper-slide").eq(pages.activeIndex).addClass('active')
			
//			取页面自定义的data-name的值并且赋值给页面a标签跳转相应搜索页面不属于js插件里的内容
            $data_father = $(".swiper-nav .active").attr('data-father');
			$data_name = $(".swiper-nav .active").attr('data-name');
			$('.comtop_center a').attr('href', $data_father+'/'+$data_name+'.html');
		},
	})

	var mySwiper = new Swiper('#banner', {
		loop: true,
		autoplay: 5000,
		calculateHeight: true,
		pagination: '.pagination',

		//其他设置
	});

	//Scroll Containers
	$('.scroll-container').each(function() {
		$(this).swiper({

			mode: 'vertical',
			scrollContainer: true,
			mousewheelControl: true,
			scrollbar: {
				container: $(this).find('.swiper-scrollbar')[0]
			}
		})
	})
    
    
    
    
})